﻿using RabbitMQ.Client;

namespace CommonLib;

public class RabbitMQUtil
{
    public static IModel CreateChannel()
    {
        var factory = new ConnectionFactory();
        factory.HostName = "localhost";
        factory.Port = 5672;
        factory.UserName = "wja";
        factory.Password = "123456";
        factory.DispatchConsumersAsync = true;
        var connection = factory.CreateConnection();
        var channel = connection.CreateModel();
        return channel;
    }
}
